"use strict";

// const Freemarker = require('freemarker/dist/app');
const path = require("node:path");
const util = require("node:util");
const FreemarkerJS = require("freemarker.js");

const fm = new FreemarkerJS({
  viewRoot: ".",
  options: {
    // eslint-disable-next-line unicorn/text-encoding-identifier-case
    encoding: "utf-8",
  },
});

fm.renderBulk(
  path.resolve("./config.fmpp", __dirname),
  /**
   * @param {Error | null} err
   * @param {string} output
   */
  (err, output) => {
    console.info(output);
    // ...
    if (!err) {
      console.info("Success");
    } else {
      console.info(err);
    }
  },
);
